﻿using System;
using System.Collections.Generic;
using System.Text;

namespace NetMicro.HttpClient.Internal
{
    /// <summary>
    /// httpclient polly组装部件
    /// </summary>
    public sealed partial class HttpClientPart
    {

        /// <summary>
        /// 是否启用polly
        /// </summary>
        public bool IsEnablePolly { get; private set; }
        /// <summary>
        /// 最多重试几次：如果为0，则不重试
        /// </summary>
        public int MaxRetryTimes { get; private set; }

        /// <summary>
        /// 重试间隔（单位：毫秒）
        /// </summary>
        public int[] RetryIntervalMilliseconds { get; private set; }

        /// <summary>
        /// 是否启用熔断
        /// </summary>
        public bool IsEnableCircuitBreaker { get; private set; }

        /// <summary>
        /// 熔断前出现允许错误几次
        /// </summary>
        public int ExceptionsAllowedBeforeBreaking { get; private set; }

        /// <summary>
        /// 熔断时间（单位：毫秒）：默认1000ms
        /// </summary>
        public int MillisecondsOfBreak { get; private set; }

    }
}
